package br.club.beer;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class InicialActivity extends Activity {

	private EditText usuario;
	private EditText senha;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_inicial);
        
        usuario = (EditText) findViewById(R.id.editText_login);
		senha = (EditText) findViewById(R.id.editText_password);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.inicial, menu);
        return true;
    }
            
    
    public void loginClique(View view){
    	String usuarioInformado = usuario.getText().toString();
    	String senhaInformada = senha.getText().toString();
    	
    	if("karen".equals(usuarioInformado) && "123".equals(senhaInformada)){
    		Intent intent = new Intent(InicialActivity.this, HomeActivity.class);
    		startActivity(intent);
    	}
    	else{
    		String mensagemErro = getString(R.string.erro_autenticacao);
    		Toast toast = Toast.makeText(this, mensagemErro, Toast.LENGTH_SHORT);
    		toast.show();
    	}
    }

}
